import Vue from 'vue'

import Cookies from 'js-cookie'
// a modern alternative to CSS resets
import 'normalize.css/normalize.css'

import Element from 'element-ui'
import './styles/element-variables.scss'
// global css
import '@/styles/index.scss'

import App from './App'
import store from './store'
import router from './router'
// icon
import './icons'
// permission control
import './permission'
// global filters
import * as filters from './filters'

import _ from 'lodash';
Vue.prototype._ = _;


// require('@/mock/mock-server')

// ...

import 'font-awesome/scss/font-awesome.scss'
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'
import VXETablePluginElement from 'vxe-table-plugin-element'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import 'vxe-table-plugin-element/dist/style.css'
// ...
Vue.use(VXETable)

// 创建一个空内容渲染
VXETable.renderer.add('NotData', {
  // 空内容模板
  renderEmpty (h, renderOpts) {
      return [
        <span>
          <p>暂无数据</p>
        </span>
      ]
    }
})
VXETable.use(VXETablePluginExportXLSX)
VXETable.use(VXETablePluginElement)




Vue.use(Element, {
  // set element-ui default size
  size: Cookies.get('size') || 'small'
})



// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
